/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.lucava.boatskeeper.server.handler.user;

import net.customware.gwt.dispatch.server.ActionHandler;
import net.customware.gwt.dispatch.server.ExecutionContext;
import net.customware.gwt.dispatch.shared.ActionException;
import org.lucava.boatskeeper.server.MockUserDao;
import org.lucava.boatskeeper.shared.rpc.user.GetUser;
import org.lucava.boatskeeper.shared.rpc.user.GetUserResult;

/**
 *
 * @author glenn
 */
public class GetUserHandler implements ActionHandler<GetUser, GetUserResult> {

    @Override
    public Class<GetUser> getActionType() {
        return GetUser.class;
    }

    @Override
    public GetUserResult execute(GetUser a, ExecutionContext ec) throws ActionException {


        GetUserResult getUserResult = new GetUserResult(MockUserDao.get(a.getId()));
        return getUserResult;
    }

    @Override
    public void rollback(GetUser a, GetUserResult r, ExecutionContext ec) throws ActionException {
    }
}
